#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include "firgamewnd.h"
#include "ccgamewnd.h"

QT_BEGIN_NAMESPACE
namespace Ui {
class Widget;
}
QT_END_NAMESPACE

class Widget : public QWidget
{
    Q_OBJECT

public:
    explicit Widget(QWidget *parent = nullptr);
    ~Widget();

protected:
    bool eventFilter(QObject *target, QEvent *event);       //重写事件过滤器

private slots:
    void on_btnSend_clicked();     //“发送”按钮的槽函数

    void on_btnConnect_clicked();    //“连接”按钮的槽函数

    void slotOutput(QString text);                          //TextEdit输出text槽函数
    void slotUpdateRoomState();                             //更新房间状态槽函数

private:
    Ui::Widget *ui;
    int witchGame = 0;  //当前为哪种游戏
    FIRGameWnd* firGameWnd = nullptr;
    CCGameWnd* ccGameWnd = nullptr;
};

#endif // WIDGET_H
